package com.fjnu.fjnu_grade_demo.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fjnu.fjnu_grade_demo.mapper.StudentCourseGradeMapper;
import com.fjnu.fjnu_grade_demo.mapper.StudentTotalGradeMapper;
import com.fjnu.fjnu_grade_demo.moudle.entity.StudentCourseGrade;
import com.fjnu.fjnu_grade_demo.moudle.entity.StudentTotalGrade;
import com.fjnu.fjnu_grade_demo.service.IStudentGradeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 学生成绩 服务实现
 */
@Service
public class StudentGradeServiceImpl extends ServiceImpl<StudentCourseGradeMapper, StudentCourseGrade>
        implements IStudentGradeService {
    
    @Autowired
    private StudentCourseGradeMapper studentCourseGradeMapper;
    
    @Autowired
    private StudentTotalGradeMapper studentTotalGradeMapper;
    
    /**
     * 根据用户名、学年和学期查询学生课程成绩列表
     * 
     * @param userName 用户名
     * @param academicYear 学年
     * @param semester 学期
     * @return 学生课程成绩列表
     */
    @Override
    public List<StudentCourseGrade> selectStudentCourseGradeList(String userName, String academicYear, String semester) {
        return studentCourseGradeMapper.selectByAcademicYearAndSemester(userName, academicYear, semester);
    }
    
    /**
     * 根据用户名、学年和学期查询学生总成绩列表
     * 
     * @param userName 用户名
     * @param academicYear 学年
     * @param semester 学期
     * @return 学生总成绩列表
     */
    @Override
    public List<StudentTotalGrade> selectStudentTotalGradeList(String userName, String academicYear, String semester) {
        return studentTotalGradeMapper.selectByAcademicYearAndSemester(userName, academicYear, semester);
    }
} 